package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.core.AgentDepositVipDao;
import com.tbit.uqbike.client.pojo.AgentDepositVip;
import com.tbit.uqbike.client.service.AgentDepositVipService;
import com.tbit.uqbike.client.util.DateTimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: chen
 * @Description: 用户区域免押
 * @Date: 创建于 11:24 2020/2/13
 */
@Service("agentDepositVipService")
public class AgentDepositVipServiceImpl implements AgentDepositVipService {
    @Autowired
    private AgentDepositVipDao agentDepositVipDao;

    @Override
    public void insert(AgentDepositVip agentDepositVip) {
        agentDepositVip.setLastUpdateDt(DateTimeUtil.getNowTime());
        agentDepositVipDao.insert(agentDepositVip);
    }

    @Override
    public AgentDepositVip getByUserId(Integer userId, Integer accountId) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("accountId", accountId);
        return agentDepositVipDao.getByUserId(map);
    }
}
